package woshiheima5;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.SimpleFormatter;

public class DataUntil {

    private DataUntil(){
//无参构造方法
    }

    public static String dataToString(Date date, String format){
        SimpleDateFormat sdf =new SimpleDateFormat();
        String s=sdf.format(date);
        return s;
    }


    public static Date stringToDate(String s,String format) throws ParseException {
        SimpleDateFormat sdf =new SimpleDateFormat();
         Date dd = sdf.parse(s);
        return dd;
    }
}
